<?php
declare (strict_types = 1);

namespace app\frontend\model;

use think\Model;

/**
 * @mixin \think\Model
 */
class ArticleComment extends Model
{
    // 模型关联，关联user表
    public function user()
    {
        return $this->belongsTo(User::class)
            ->bind(['author' => 'nickname']);
    }

    // 模型关联，关联article表
    public function articleTitle()
    {
        return $this->belongsTo(Article::class)
            ->bind(['title']);
    }
}
